<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <p class="content"></p>
    <script>
        // 计算现在时间距离 2022年6月27号9:00 时间差 显示页面上，实时倒计时。
        function fn() {
            var nowTime = new Date().getTime();
            var myTime = new Date(2022, 5, 27, 9, 0, 0).getTime();
            var res = myTime - nowTime;
            document.getElementsByClassName("content")[0].innerHTML = res;
        }
        setInterval(function () {
            fn();
        }, 1000)
    </script>
</body>
</html>